//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.carhailing.system.config;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ThreadPoolExcuterConfig {
    public ThreadPoolExcuterConfig() {
    }

    @Bean
    public ThreadPoolExecutor getThreadPoolExecutor(ThreadPoolConfig threadPoolConfig) {
        return new ThreadPoolExecutor(threadPoolConfig.getCorePoolSize(), threadPoolConfig.getMaximumPoolSize(), (long)threadPoolConfig.getKeepAliveTime(), TimeUnit.SECONDS, new LinkedBlockingQueue(2000), Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy());
    }
}
